Imaging device, focusing control method, and computer readable non-transitory recording medium

ABSTRACT

There are provided an imaging device, a focusing control method, and a focusing control program which are capable of realizing focusing control at a high speed with high accuracy. A digital camera includes an imaging element 5 that has pixels including phase-difference detecting pixels 52A and 52B and images a subject through an imaging optical system including a focus lens, and a system controller 11 that selectively performs focusing control using a phase difference AF method or focusing control using a contrast AF method in a mode in which focusing control for focusing on a main subject by driving the focus lens is continuously performed multiple times. The system controller 11 performs the focusing control using the contrast AF method in a case where a state in which a degree of reliability of the focusing control using the phase difference AF method is equal to or less than a threshold value persists N times (N is a natural number of 2 or more) while the focusing control using the phase difference AF method is continuously performed.

CROSS REFERENCE TO RELATED APPLICATION

This is a continuation of International Application No.PCT/JP2017/020474 filed on Jun. 1, 2017, and claims priority fromJapanese Patent Application No. 2016-110391 filed on Jun. 1, 2016, theentire disclosures of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to an imaging device, a focusing controlmethod, and a computer readable medium storing a focusing controlprogram.

2. Description of the Related Art

In recent years, with an increase in resolution of imaging elements,such as a charge coupled device (CCD) image sensor and a complementarymetal oxide semiconductor (CMOS) image sensor, there is a rapid increasein demand for information devices having an imaging function, such as adigital still camera, a digital video camera, and a smartphone. Theinformation devices having an imaging function described above arereferred to as imaging devices.

In these imaging devices, a contrast auto focus (AF) method is employedas a focusing control method of focusing on a main subject.

JP2011-215482A and JP2014-149540A describe an imaging device thatperforms focusing control by using the contrast AF method.

JP2013-041075A describes an imaging device that performs the focusingcontrol using the contrast AF method in a case where a defocus valuecalculated by a phase difference AF method is equal to or less than athreshold value.

JP2006-350188A describes an imaging device that performs the focusingcontrol by using the phase difference AF method until a subject enterswithin a depth of field and then performs the focusing control using thecontrast AF method.

JP2007-179029A describes an imaging device capable of setting a mode inwhich the focusing control using the phase difference AF method isperformed and a mode in which focusing control in which the phasedifference AF method and the contrast AF method are combined or thefocusing control using the contrast AF method is selectively performed.

SUMMARY OF THE INVENTION

Since the phase difference AF method and the contrast AF method haveadvantages and disadvantages, it is possible to improve focusingaccuracy by distinguishing between the phase difference AF method andthe contrast AF method.

Since the imaging device described in JP2011-215482A and JP2014-149540Aperforms the focusing control by using only the contrast AF method, thefocusing accuracy deteriorates in a case where a subject inappropriatefor the contrast AF method is captured. Such an imaging device is notappropriate for a case where the imaging device continues to focus on asubject moving at a high speed.

Since the imaging device described in JP2013-041075A and JP2006-350188Aperforms the focusing control in which the phase difference AF methodand the contrast AF method are combined, a time until AF is completedbecomes long as compared to a case where the focusing control isperformed by using only the phase difference AF method. Thus, such animaging device is not appropriate for a case where the imaging devicecontinues to focus on a subject moving at a high speed.

In the imaging device described in JP2007-17929A, in a case where themode in which the focusing control using the contrast AF method or thefocusing control in which the contrast AF method and the phasedifference AF method are combined is selectively performed is set, thefocusing accuracy deteriorates in an imaging scene in which the imagingdevice continues to focus on the subject moving at a high speed. In acase where the mode in which the focusing control using the phasedifference AF method is performed is set, the focusing accuracydeteriorates in a case where the subject inappropriate for the phasedifference AF method is captured.

The present invention has been made in view of the circumstances, and anobject of the present invention is to provide an imaging device, afocusing control method, and a focusing control program which arecapable of realizing focusing control at a high speed with highaccuracy.

An imaging device according to the present invention comprises animaging element that images a subject through an imaging optical systemincluding a focus lens, first signal detection parts that detect signalscorresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of the imaging optical system, secondsignal detection parts that detect signals corresponding to the otherone of the pair of luminous fluxes, and a focusing controller thatselectively performs focusing control using a phase difference AF methodusing a result of a correlation operation of detection signals of thefirst signal detection parts and detection signals of the second signaldetection parts or focusing control using a contrast AF method usingcontrast of a captured image captured by the imaging element in a modein which focusing control for focusing on a main subject by driving thefocus lens is continuously performed multiple times. The focusingcontroller performs the focusing control using the contrast AF method ina case where a state in which a degree of reliability of the focusingcontrol using the phase difference AF method is equal to or less than athreshold value persists N times, N being a natural number of 2 or more,while the focusing control using the phase difference AF method iscontinuously performed.

A focusing control method according to the present invention comprises afocusing control step of selectively performing focusing control using aphase difference AF method using a result of a correlation operation ofdetection signals of first signal detection parts that detect signalscorresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of an imaging optical system anddetection signals of second signal detection parts that detect signalscorresponding to the other one of the pair of luminous fluxes orfocusing control using a contrast AF method using contrast of a capturedimage captured by an imaging element that images a subject through theimaging optical system, in a case where focusing control for focusing ona main subject by driving a focus lens of the imaging optical systemincluding the focus lens is continuously performed multiple times. Inthe focusing control step, the focusing control using the contrast AFmethod is performed in a case where a state in which a degree ofreliability of the focusing control using the phase difference AF methodis equal to or less than a threshold value persists N times, N being anatural number of 2 or more, while the focusing control using the phasedifference AF method is continuously performed.

A focusing control program according to the present invention causes acomputer to perform a focusing control step of selectively performingfocusing control using a phase difference AF method using a result of acorrelation operation of detection signals of first signal detectionparts that detect signals corresponding to one of pair of luminousfluxes passed through different portions of a pupil area of an imagingoptical system and detection signals of second signal detection partsthat detect signals corresponding to the other one of the pair ofluminous fluxes or focusing control using a contrast AF method usingcontrast of a captured image captured by an imaging element that imagesa subject through the imaging optical system, in a case where focusingcontrol for focusing on a main subject by driving a focus lens of theimaging optical system including the focus lens is continuouslyperformed multiple times. In the focusing control step, the focusingcontrol using the contrast AF method is performed in a case where astate in which a degree of reliability of the focusing control using thephase difference AF method is equal to or less than a threshold valuepersists N times, N being a natural number of 2 or more, while thefocusing control using the phase difference AF method is continuouslyperformed.

According to the present invention, it is possible to provide an imagingdevice, a focusing control method, and a focusing control program whichare capable of realizing focusing control at a high speed with highaccuracy.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram showing a schematic configuration of a digitalcamera which is an embodiment of an imaging device according to thepresent invention.

FIG. 2 is a planar schematic diagram showing a configuration of animaging element 5 mounted on the digital camera shown in FIG. 1.

FIG. 3 is a partial enlarged view of one AF area 53 shown in FIG. 2.

FIG. 4 is a diagram showing phase-difference detecting pixelsconstituting any pair row shown in FIG. 3.

FIG. 5 is a diagram showing a cross-sectional configuration ofphase-difference detecting pixel 52A.

FIG. 6 is a diagram showing a configuration in which all pixels includedin the imaging element 5 are imaging pixels and each imaging pixel isdivided into two.

FIG. 7 is a flowchart for describing an operation of the digital camerashown in FIG. 1 in a continuous AF mode.

FIGS. 8A and 8B are schematic diagrams for describing a setting exampleof a contrast AF area.

FIG. 9 is a flowchart for describing a modification example of theoperation of the digital camera shown in FIG. 1 in the continuous AFmode.

FIGS. 10A and 10B are schematic diagrams for describing another settingexample of the contrast AF area.

FIGS. 11A and 11B are schematic diagrams for describing still anothersetting example of the contrast AF area.

FIG. 12 is a diagram showing a modification example of the digitalcamera shown in FIG. 1.

FIG. 13 is a flowchart for describing the operation of the digitalcamera shown in FIG. 12 in the continuous AF mode.

FIG. 14 is a schematic diagram for describing a setting example of acontrast AF area of the digital camera shown in FIG. 12.

FIG. 15 is a schematic diagram for describing a setting example of thecontrast AF area of the digital camera shown in FIG. 12.

FIG. 16 shows an external appearance of a smartphone 200 which is anembodiment of the imaging device according to the present invention.

FIG. 17 is a block diagram showing a configuration of the smartphone 200shown in FIG. 16.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Hereinafter, an embodiment of the present invention will be describedwith reference to the drawings.

FIG. 1 is a diagram showing a schematic configuration of a digitalcamera which is an embodiment of an imaging device according to thepresent invention.

The digital camera shown in FIG. 1 comprises a lens device 40 thatincludes an imaging lens 1, a stop 2, a lens controller 4, a lens driveunit 8, and a stop drive unit 9.

In the present embodiment, the lens device 40 may be attachably anddetachably provided on a digital camera main body, or may be fixed tothe digital camera main body.

The imaging lens 1 and the stop 2 constitute an imaging optical system,and the imaging optical system includes at least a focus lens. The focuslens is a lens for adjusting a focus position of the imaging opticalsystem, and is composed of a single lens or a plurality of lenses. Thefocus lens moves in an optical axis direction of the imaging opticalsystem, and thus, the focus position is adjusted.

A liquid lens capable of changing a focus position by performingvariable control on a curved surface of the lens may be used as thefocus lens.

The lens controller 4 of the lens device 40 can communicate with asystem controller 11 of the digital camera main body in a wired orwireless manner.

The lens controller 4 drives the focus lens included in the imaging lens1 through the lens drive unit 8 or drives the stop 2 through the stopdrive unit 9 according to a command from the system controller 11.

The digital camera main body comprises an imaging element 5 that imagessubjects through the imaging optical system, such as a CCD image sensoror a CMOS image sensor, an analog signal processing unit 6 that isconnected to an output of the imaging element 5 to perform analog signalprocessing such as sampling two correlation pile processing, ananalog-to-digital conversion circuit 7 that converts analog signalsoutput from the analog signal processing unit 6 into digital signals, animaging element drive unit 10, the system controller 11 that generallycontrols the entire system, and a manipulation unit 14.

The analog signal processing unit 6, the analog-to-digital conversioncircuit 7, and the imaging element drive unit 10 are controlled by thesystem controller 11.

The system controller 11 drives the imaging element 5 through an imagingelement drive unit 10, and outputs, as a captured image signal, asubject image captured through the imaging optical system. A commandsignal from a user is input to the system controller 11 through amanipulation unit 14.

The system controller 11 includes various processors and memories suchas a random access memory (RAM) and a read only memory (ROM).

The various processors include a central processing unit (CPU) which isa general-purpose processor that performs various processing, aprogrammable logic device (PLD) which is a processor capable of changinga circuit configuration after a field-programmable gate array ismanufactured, and a dedicated electric circuit which is a processorhaving a dedicated circuit configuration designed for performing aspecific process such as an Application-Specific Integrated Circuit(ASIC).

More specifically, the structures of the various processors are electriccircuits obtained by combining circuit elements such as semiconductordevices.

The system controller 11 may be constituted by one of the variousprocessors, or may be constituted by a combination (for example, acombination of a plurality of FPGAs or a combination of the CPU and theFPGA) of two or more processors of the same type or different types.

The system controller 11 realizes functions to be described below byexecuting programs including a focusing control program stored in abuilt-in ROM.

The electric control system of the digital camera further comprises amain memory 16, a memory controller 15 that is connected to the mainmemory 16, a digital signal processing unit 17 that generates capturedimage data by performing signal processing on the captured image signaloutput from the analog-to-digital conversion circuit 7, a contrast AFprocessing unit 18 that determines a focusing position by a contrast AFmethod, a phase difference AF processing unit 19 that calculates adefocus value by a phase difference AF method, an external memorycontroller 20 to which an attachable and detachable recording medium 21is connected, and a display controller 22 to which a display unit 23mounted on a camera rear surface is connected.

The memory controller 15, the digital signal processing unit 17, thecontrast AF processing unit 18, the phase difference AF processing unit19, the external memory controller 20, and the display controller 22 areconnected to each other through a control bus 24 and a data bus 25, andare controlled according to a command from the system controller 11. Thecontrast AF processing unit 18 and the phase difference AF processingunit 19 are function blocks formed by cooperating with various hardwareby the focusing control program being executed by the processor of thesystem controller 11.

FIG. 2 is a planar schematic diagram showing a configuration of theimaging element 5 mounted on the digital camera shown in FIG. 1.

The imaging element 5 has a light receiving surface 50 on which aplurality of pixels arranged in two dimensions in a row direction X anda column direction Y perpendicular to the row direction X.

In the example of FIG. 2, 63 focus detection areas (hereinafter,referred to as AF areas) 53 which are areas to be in focus (areas inwhich a subject image to be in focus is formed) are formed on the lightreceiving surface 50.

In the digital camera shown in FIG. 1, focusing control for selectingone pixel or a plurality of consecutively arranged pixels among the 63AF areas 53 shown in FIG. 2 and focusing on subjects to be captured bythe selected AF area 53 is performed.

The AF area 53 is an area that includes imaging pixels andphase-difference detecting pixels, as pixels. Only the imaging pixelsare arranged in a portion of the light receiving surface 50 except forthe AF areas 53.

FIG. 3 is a partial enlarged view of one AF area 53 shown in FIG. 2.

Pixels 51 (square blocks in FIG. 3) are arranged in two dimensions inthe AF area 53. Each pixel 51 includes a photoelectric conversion unitsuch as a photodiode and a color filter formed above the photoelectricconversion unit. Each pixel 51 may separate light depending on astructure of the photodiode without using the color filter.

In FIG. 3, the pixel 51 (R pixels 51) including a color filter (Rfilter) transmitting red light is assigned a character of “R”.

In FIG. 3, the pixel 51 (G pixel 51) including a color filter (G filter)transmitting green light is assigned a character of “G”.

In FIG. 3, the pixel 51 (B pixel 51) including a color filter (B filter)transmitting blue light is assigned a character of “B”. The arrangementof the color filters is a Bayer array on the entire light receivingsurface 50.

In the AF area 53, some (hatched pixels in FIG. 3) of the G pixels 51are phase-difference detecting pixels 52A and 52B. In the example ofFIG. 3, the G pixels 51 in any pixel row among pixel rows each includingthe R pixels 51 and the G pixels 51 are the phase-difference detectingpixels 52A, and the G pixels 51 having the same color which are closestto the G pixels 51 serving as the phase-difference detecting pixels 52Ain the column direction Y are the phase-difference detecting pixels 52B.

The phase-difference detecting pixel 52A and the phase-differencedetecting pixel 52B having the same color which is closest to thephase-difference detecting pixel 52A in the column direction Y arepaired.

A pair row PL1 constituted by a plurality of pairs arranged in the rowdirection X is constituted by the phase-difference detecting pixels 52Apresent in the third pixel row from the top in FIG. 3 and thephase-difference detecting pixels 52B present in the fifth pixel rowfrom the top in FIG. 3.

A pair row PL2 constituted by a plurality of pairs arranged in the rowdirection X is constituted by the phase-difference detecting pixels 52Apresent in the seventh pixel row from the top in FIG. 3 and thephase-difference detecting pixels 52B present in the ninth pixel rowfrom the top in FIG. 3.

A pair row PL3 constituted by a plurality of pairs arranged in the rowdirection X is constituted by the phase-difference detecting pixels 52Apresent in the eleventh pixel row from the top in FIG. 3 and thephase-difference detecting pixels 52B present in the thirteenth pixelrow from the top in FIG. 3.

As stated above, the plurality of pair rows are arranged in the columndirection Y in the AF area 53.

FIG. 4 is a diagram showing the phase-difference detecting pixelsconstituting any pair row shown in FIG. 3.

The phase-difference detecting pixels 52A are first signal detectionparts that receive luminous flux passed through one division areaobtained by dividing a pupil area of the imaging lens 1 into twodivisions in the row direction X and detect signals corresponding tolight reception amounts.

The phase-difference detecting pixels 52B are second signal detectionparts that receive luminous flux passed through the other division areaof the pupil area and detect signals corresponding to light receptionamounts.

In the AF area 53, the plurality of pixels 51 other than thephase-difference detecting pixels 52A and 52B is the imaging pixels. Theimaging pixels receive luminous flux passed through both the twodivision areas of the pupil area of the imaging lens 1, and detectsignals corresponding to light reception amounts.

A light shielding film is formed above the photoelectric conversion unitof each pixel 51, and an opening that defines a light reception area ofthe photoelectric conversion unit is formed in the light shielding film.

A center of the opening of the imaging pixel matches a center of thephotoelectric conversion unit of the imaging pixel. In contrast, acenter of an opening (a white portion of FIG. 4) of the phase-differencedetecting pixel 52A is eccentric to the right side with respect to acenter of the photoelectric conversion unit of the phase-differencedetecting pixel 52A.

A center of an opening (a white portion of FIG. 4) of thephase-difference detecting pixel 52B is eccentric to the left side withrespect to a center of the photoelectric conversion unit of thephase-difference detecting pixel 52B.

FIG. 5 is a diagram showing a cross-sectional configuration of thephase-difference detecting pixel 52A. As shown in FIG. 5, an opening cof the phase-difference detecting pixel 52A is eccentric to the rightwith respect to a photoelectric conversion unit PD.

As shown in FIG. 5, one side of the photoelectric conversion unit PD iscovered by the light shielding film, and thus, it is possible toselectively shield light rays incident in a direction opposite to adirection covered by the light shielding film.

With such a configuration, it is possible to detect a phase differencein the row direction X on images captured by each of two pixel groupssuch as a pixel group including the phase-difference detecting pixels52A constituting any pair row and a pixel group including thephase-difference detecting pixels 52B constituting the pair row.

The pixel configuration of the imaging element 5 is not limited to theconfiguration shown in FIGS. 2 to 5.

For example, all the pixels included in the imaging element 5 may be theimaging pixels, one division portion obtained by dividing each imagingpixel into two in the row direction X may be the phase-differencedetecting pixel 52A, and the other division portion may be thephase-difference detecting pixel 52B.

FIG. 6 is a diagram showing a configuration in which all the pixels 51included in the imaging element 5 are the imaging pixels and each pixel51 is divided into two.

In the configuration of FIG. 6, in the imaging element 5, the pixel 51assigned R is divided into two, and two divided portions arerespectively a phase-difference detecting pixel r1 and aphase-difference detecting pixel r2.

in the imaging element 5, the pixel 51 assigned G is divided into two,and two divided portions are respectively a phase-difference detectingpixel g1 and a phase-difference detecting pixel g2.

in the imaging element 5, the pixel 51 assigned B is divided into two,and two divided portions are respectively a phase-difference detectingpixel b1 and a phase-difference detecting pixel b2.

In this configuration, the phase-difference detecting pixels r1, g1, andb1 are first signal detection parts, and the phase-difference detectingpixels r2, g2, and b2 are second signal detection parts. Twophase-difference detecting pixels included in one pixel 51 constitute apair.

In the configuration example of FIG. 6, in a case where the signals ofthe first signal detection part and the second signal detection partincluded in one pixel 51 are added, a normal imaging signal with nophase difference is obtained. That is, in the configuration of FIG. 6,all the pixels may be used as both of the phase-difference detectingpixels and the imaging pixels. In the configuration example of FIG. 6,it is possible to improve a degree of freedom in setting of the size andshape of the AF area.

The system controller 11 selectively performs the focusing control usingthe phase difference AF method or the focusing control using thecontrast AF method. The system controller 11 constitutes a focusingcontroller.

According to a command of the system controller 11, the phase differenceAF processing unit 19 calculates a phase difference which is a relativepositional deviation amount of the two images formed by the pair ofluminous fluxes by using a detection signal group read out from thephase-difference detecting pixels 52A and the phase-difference detectingpixels 52B present in one AF area or the plurality of AF areas 53(hereinafter, referred to as phase difference AF areas) selected by auser's manipulation among the 63 AF areas 53. The phase difference AFarea constitute a second subject area.

The phase difference AF processing unit 19 obtains an amount separatedfrom a focus adjustment state of the imaging lens 1, for example, afocusing state and a direction separated from the focusing state, thatis, a defocus value based on the phase difference.

The system controller 11 performs the focusing control using the phasedifference AF method using the result of a correlation operation bydriving the focus lens based on the defocus value.

The contrast AF processing unit 18 analyzes a captured image to becaptured by the imaging element 5, and determines the focusing positionof the imaging lens 1 by the contrast AF method.

That is, the contrast AF processing unit 18 obtains contrast (adifference in brightness) of the captured image obtained for each ofmoved positions (a plurality of positions) while moving the focus lensposition of the imaging lens 1 under the control of the systemcontroller 11. The focus lens position in which contrast is maximum isdetermined as the focusing position.

The system controller 11 performs the focusing control using thecontrast AF method using the contrast of the captured image by drivingthe focus lens based on the focusing position determined by the contrastAF processing unit 18.

The digital camera having the configuration described above is providedwith a continuous AF mode in which the focusing control for focusing ona main subject is continuously performed multiple times. Hereinafter, anoperation of the digital camera in the continuous AF mode will bedescribed.

FIG. 7 is a flowchart for describing the operation of the digital camerashown in FIG. 1 in the continuous AF mode.

Initially, the manipulation unit 14 is manipulated in a state in whichany area (hereinafter, one AF area 53 is used) is selected by a user ofthe digital camera among the 63 AF areas 53, and a command to perform AFis performed.

According to the command, the phase difference AF processing unit 19calculates, for example, a correlation value by performing a correlationoperation of an average value of the detection signals of thephase-difference detecting pixels 52A of which the positions in the rowdirection X are the same, which are included in all the pair rowsincluded in the phase difference AF area and an average value of thedetection signals of the phase-difference detecting pixels 52B of whichthe positions in the row direction X are the same, which are included inall the pair rows, calculates a phase difference based on thecorrelation value, and calculates a defocus value based on the phasedifference (step S1).

Subsequently, the system controller 11 determines a degree ofreliability of the defocus value calculated in step S1, that is, adegree of reliability of the focusing control using the phase differenceAF method (step S2).

For example, in a graph in which a vertical axis represents thecorrelation value calculated in step S1 and a vertical axis represents adeviation amount between two detection signal groups as targets forwhich the correlation value is obtained in the row direction X, thesystem controller 11 determines that the degree of reliability of thefocusing control using the phase difference AF method is equal to orless than a threshold value TH in a case where there is a plurality ofminimum points or a case where there is no minimum point.

Meanwhile, in a case where there is only one minimum point in the graphand the correlation value at the minimum point is smaller than apredetermined value, the system controller 11 determines that the degreeof reliability of the focusing control using the phase difference AFmethod exceeds the threshold value TH. Another known method may beemployed as the method of determining the degree of reliability.

In a case where the degree of reliability of the focusing control usingthe phase difference AF method exceeds the threshold value TH (step S2:YES), the system controller 11 resets a count value of a built-incounter to an initial value (=0) (step S3).

The system controller 11 moves the focus lens to the focusing positionby driving the focus lens (by performing the focusing control using thephase difference AF method) based on the defocus value calculated instep S1 (step S4).

The system controller 11 returns the processing to step S1 after thefocusing control using the phase difference AF method is ended, andperforms an operation for the next AF.

In a case where it is determined that the degree of reliability of thefocusing control using the phase difference AF method is equal to orless than the threshold value TH (step S2: NO), the system controller 11increases the count value of the built-in counter by one (step S5), andthen determines whether or the count value reaches N (step S6). N is anynatural value of 2 or more.

In a case where the count value does not reach N (step S6: NO), thesystem controller 11 performs the processing of step S4.

In a case where the count value reaches N (step S6: YES), the systemcontroller 11 sets a contrast AF area which is an area in which subjectsto be in focus in a case where the focusing control using the contrastAF method is formed based on the phase difference AF area (step S7).

The contrast AF area constitutes a first subject area.

FIGS. 8A and 8B are schematic diagrams for describing a setting exampleof the contrast AF area.

For example, it is assumed that the phase difference AF area is the AFarea 53 (surrounded by a thick frame in FIG. 8A) present in the centeramong the 63 AF areas 53, as shown in FIG. 8A.

In this case, in step S7, the system controller 11 sets, as the contrastAF area, an area (an area including nine AF areas 53 and spacingsbetween these nine AF areas 53) surrounded by nine AF areas 53 includingthe central AF area 53 and eight AF areas 53 (surrounded by dashedframes in FIG. 8B) present near the central AF area 53, as shown in FIG.8B.

The contrast AF area may be an area that includes the phase differenceAF area and is larger than the phase difference AF area, and is notlimited to the setting example shown in FIGS. 8A and 8B.

After step S7, the contrast AF processing unit 18 determines thefocusing position based on the contrast of a captured image to becaptured by the contrast AF area. The system controller 11 performs thefocusing control using the contrast AF method by moving the focus lensto the focusing position (step S8).

After the focusing control using the contrast AF method is performed,the system controller 11 resets the setting of the contrast AF area andthe count value of the built-in counter (step S9). Thereafter, thesystem controller returns the processing to step S1, and then performsan operation for the next AF.

As described above, according to the digital camera shown in FIG. 1, thefocusing control using the phase difference AF method is continuouslyperformed in a state in which the degree of reliability of the focusingcontrol using the phase difference AF method exceeds to the thresholdvalue TH. Thus, it is possible to continue to focus on even a subjectmoving at a high speed.

Meanwhile, even though the degree of reliability of the focusing controlusing the phase difference AF method is equal to or less than thethreshold value TH, in a case where this state does not persist N times,the focusing control using the phase difference AF method iscontinuously performed.

Thus, it is possible to continue to focus on even a subject moving at ahigh speed. The focusing control using the phase difference AF methodhas a low possibility that the imaging lens will be greatly deviatedfrom the focusing state (large blurriness occurs) even though theimaging is performed in a state in which the degree of reliability islow. Accordingly, it is possible to maintain a balance between thefollowability to the subject and the focusing accuracy.

According to the digital camera shown in FIG. 1, in the continuous AFmode, in a case where the state in which the degree of reliability ofthe focusing control using the phase difference AF method is equal to orless than the threshold value TH persists N times, the focusing controlusing the contrast AF method is performed for the first time.

As stated above, it is possible to maintain the balance between thefollowability to the subject and the focusing accuracy by performing thefocusing control using the contrast AF method for the first time in acase where the state in which the degree of reliability of the focusingcontrol using the phase difference AF method is low persists for apredetermined period.

A professional photographer waits for a time of about 2 to 3 secondsfrom a point of time when a desired subject is not properly in focus ina case where continuous AF is performed, and takes action such asswitching the mode from continuous AF to manual AF in a case where thesubject is still not in focus.

Meanwhile, a time from when the processing of step S1 of FIG. 7 isstarted to a time when the processing of step S2 is ended is a shorttime of about 0.2 seconds. Accordingly, it is preferable that the valueof N is set to about 10 to 15 seconds with consideration for suchcircumstances.

As the value of N, any value may be set by the user through themanipulation unit 14. According to this configuration, it is possible toperform the continuous AF appropriate for user's preference.

According to the digital camera shown in FIG. 1, a probability that thefocusing control using the phase difference AF method will be performedis higher than a probability that the focusing control using thecontrast AF method will be performed during the continuous AF mode.Thus, it is possible to achieve low power consumption.

According to the digital camera shown in FIG. 1, the contrast AF arealarger than the phase difference AF area used in a case where thefocusing control using the phase difference AF method is performed isset in a case where the focusing control using the contrast AF method isperformed.

As state above, it is possible to improve focusing accuracy using thecontrast AF method by setting the contrast AF area having the largesize.

In a case where the focusing position is not uniquely determined by thecontrast AF processing unit 18 in step S8, the system controller 11repeatedly performs processing for performing the expansion of thecontrast AF area and the determination of the focusing position untilthe focusing position is uniquely determined without performing thefocusing control using the contrast AF method.

The system controller 11 may return the processing to step S1 by movingthe focus lens to the focusing position at a point of time when thefocusing position is uniquely determined. By doing this, it is possibleto improve the focusing accuracy.

In FIG. 7, the processing of step S7 may not be performed. In this case,the processing of step S8 is performed in a case where the determinationresult of step S6 is YES, and the contrast AF processing unit 18 maydetermine the focusing position based on the contrast of the capturedimage to be captured by the phase difference AF area in step S8.

The system controller 11 may perform variable control on the value of N.

For example, it is assumed that a first mode in which it is assumed thatthe digital camera shown in FIG. 1 images the same subject whilefocusing on the same subject for a long time (for example, a mode inwhich it is assumed that the digital camera images a train or a vehiclethat is traveling) and a second mode in which it is assumed that thedigital camera images subjects to be in focus while frequently switchingbetween these subjects (for example, a mode in which it is assumed thatthe digital camera images a sports landscape such as a ball gameperformed by multiple people) are able to be set.

In this case, the system controller 11 sets the value of N in a casewhere the first mode is set to be larger than the value of N in a casewhere the second mode is set.

In a case where the subjects to be in focus are frequently switched andthe subjects to be in focus are switched, there is a high possibilitythat the imaging lens is greatly deviated from the focusing state. Thus,in the second mode, the focusing control using the contrast AF method iseasily performed by decreasing the value of N, and thus, it is possibleto improve the quality of the captured image.

Meanwhile, the value of N increases in the first mode in which thesubject to be in focus is hardly changed, and thus, the focusing controlusing the phase difference AF method is easily performed. As a result,it is possible to focus on the subject moving at a high speed with highaccuracy, and thus, it is possible to improve the quality of thecaptured image.

Hereinafter, a modification example of the digital camera shown in FIG.1 will be described.

First Modification Example

FIG. 9 is a flowchart for describing a modification example of anoperation of the digital camera shown in FIG. 1 in the continuous AFmode. In FIG. 9, the same processing as the processing shown in FIG. 7will be assigned the same reference, and the description thereof will beomitted.

The system controller 11 performs the processing of step S10 in a casewhere the determination result of step S6 is NO.

In step S10, the system controller 11 calculates an elapsed time from apoint of time when the count value is 1 (a point of time when the degreeof reliability of the focusing control using the phase difference AFmethod is equal to or less than the threshold value TH) to the currentpoint of time, and determines whether or not the elapsed time reaches atime threshold value.

In a case where it is determined that the elapsed time does not reachthe time threshold value (step S10: NO), the system controller 11performs the processing of step S4.

Meanwhile, in a case where it is determined that the elapsed timereaches the time threshold value (step S10: YES), the system controller11 performs the processing of step S7 and the subsequent processing.

As described above, according to the first modification example, eventhough the state in which the degree of reliability of the focusingcontrol using the phase difference AF method is equal to or less thanthe threshold value TH does not persist N times, in a case where theelapsed time after the degree of reliability is equal to or less thanthe threshold value TH reaches the time threshold value, the focusingcontrol using the contrast AF method is performed.

As stated above, even in a situation in which a time until the focusingcontrol using the phase difference AF method is completed increases asin a case where imaging is performed in a dark environment, it ispossible to restrain a situation in which the focusing control using thecontrast AF method is not properly performed by determining whether ornot to perform the focusing control using the contrast AF method byadding the elapsed time after the count value becomes 1 (count value=1)in addition to the count value.

Accordingly, it is possible to improve the quality of the captured imageby improving the focusing accuracy even in a case where the imaging isperformed in the dark environment.

Second Modification Example

It is preferable that the system controller 11 sets the contrast AF areasuch that a difference between a width of the contrast AF area in therow direction X and a width of the phase difference AF area in the rowdirection X is greater than a difference between a width of the contrastAF area in the column direction Y and a width of the phase difference AFarea in the column direction Y.

In this modification example, the row direction X constitutes a firstdirection, and the column direction Y constitutes a second direction.

In a case where the phase difference AF area is constituted by theplurality of AF areas 53, a width of the phase difference AF area in anydirection means a width of an area including the plurality of AF areas53 and the spacings between the plurality of AF areas 53 in anydirection.

FIGS. 10A and 10B are schematic diagrams for describing another settingexample of the contrast AF area.

For example, it is assumed that the phase difference AF area is the AFarea 53 (surrounded by a thick frame in FIG. 10A) present in the centeramong the 63 AF areas 53, as shown in FIG. 10A.

In this case, in step S7 of FIG. 7 or 9, the system controller 11 sets,as the contrast AF area, an area surrounded by five AF areas 53including the central AF area 53, two AF areas 53 (surrounded by dashedframes in FIG. 10B) adjacent to the central AF area 53 in the rowdirection X, and four AF areas 53 (surrounded by dashed frames in FIG.10B) including the AF areas 53 adjacent to the two adjacent AF areas 53,as shown in FIG. 10B.

FIGS. 11A and 11B are schematic diagrams for describing still anothersetting example of the contrast AF area.

For example, it is assumed that the phase difference AF area is the AFarea 53 (surrounded by a thick frame in FIG. 11A) present in the centeramong the 63 AF areas 53, as shown in FIG. 11A.

In this case, in step S7 of FIG. 7 or 9, the system controller 11 sets,as the contrast AF area, an area surrounded by 15 AF areas 53 includingthe central AF area 53 and 14 AF areas 53 (surrounded by dashed framesin FIG. 11B) present near the central AF area 53, as shown in FIG. 11B.

In a case where a posture of the digital camera is so-called lateralphotographing which is a posture of which a direction of gravity isparallel to the column direction Y, a change in distance to the subjectcaptured by the imaging element 5 increases in the column direction Y,and decreases in the row direction X.

Thus, as shown in FIGS. 10A to 11B, the contrast AF area is set in ashape elongated in the row direction X in which a change in the subjectdistance is relatively small, and thus, it is possible to reduce apossibility that a subject present at a distance greatly different fromthe main subject will be included in the subjects to be captured by thecontrast AF area. Accordingly, it is possible to improve the accuracy ofthe focusing control using the contrast AF method.

Third Modification Example

FIG. 12 is a diagram showing a modification example of the digitalcamera shown in FIG. 1. The digital camera shown in FIG. 12 has the sameconfiguration as that in FIG. 1 except that an acceleration sensor 26 isadded.

For example, the acceleration sensor 26 is a sensor that detectsaccelerations in three axis directions such as an x-axis, a y-axis, anda z-axis, and may detect a direction of gravity by output signals of thesensor.

The system controller 11 detects the direction of gravity based on theoutput signals of the acceleration sensor 26. The system controller 11constitutes a detection unit.

FIG. 13 is a flowchart for describing an operation of the digital camerashown in FIG. 12 in the continuous AF mode. In FIG. 13, the sameprocessing as the processing of FIG. 9 will be assigned the samereference, and the description thereof will be omitted.

In a case where the determination result of step S10 is YES or thedetermination result of step S6 is YES, the system controller 11 detectsthe direction of gravity based on the output signals of the accelerationsensor 26 (step S11).

The system controller 11 sets the contrast AF area based on the detecteddirection of gravity and the phase difference AF area (step S12).

Specifically, in a case where the detected direction of gravity isperpendicular to the row direction X, the system controller 11 sets thecontrast AF area such that a difference between a width of the contrastAF area in the row direction X and a width of the phase difference AFarea in the row direction X is greater than a difference between a widthof the contrast AF area in the column direction Y and a width of thephase difference AF area in the column direction Y, as shown in FIG. 14.

In this modification example, in a case where the detected direction ofgravity is perpendicular to the row direction X, the row direction Xconstitutes a first direction, and the column direction Y constitutes asecond direction.

Meanwhile, in a case where the detected direction of gravity isperpendicular to the column direction Y, the system controller 11 setsthe contrast AF area such that a difference between a width of thecontrast AF area in the column direction Y and a width of the phasedifference AF area in the column direction Y is greater than adifference between a width of the contrast AF area in the row directionX and a width of the phase difference AF area in the row direction X, asshown in FIG. 15.

In this modification example, in a case where the detected direction ofgravity is perpendicular to the column direction Y, the column directionY constitutes a first direction, and the row direction X constitutes asecond direction.

A case where two directions are perpendicular to each other is notlimited to a case where an angle formed by the two directions iscompletely 90 degrees, and means a state in which this angle isapproximately 90 degrees (for example, a range of 80 degrees or more and100 degrees or less).

After step S12, the processing of step S8 and the subsequent processingare performed.

According to the third modification example, since the contrast AF areais set depending on the posture of the digital camera, even in a casewhere the posture of the digital camera is longitudinal photographing orlateral photographing, it is possible to improve the focusing accuracyin a case where the focusing control using the contrast AF method isperformed.

In FIG. 13, the processing of step S10 may not be performed. In a casewhere step S10 is omitted and the determination result of step S6 is NO,the processing of step S4 is performed.

Hereinafter, a configuration of a smartphone as the imaging device willbe described.

FIG. 16 shows an external appearance of a smartphone 200 which is anembodiment of the imaging device according to the present invention.

The smartphone 200 shown in FIG. 16 has a flat casing 201, and comprisesa display input unit 204 in which a display panel 202 as a display unitand a manipulation panel 203 as an input unit are integrally formed onone surface of the casing 201.

Such a casing 201 comprises a speaker 205, a microphone 206, amanipulation unit 207, and a camera unit 208.

The configuration of the casing 201 is not limited thereto. For example,the display unit and the input unit may be independent of each other, ormay have a folding structure or a slide mechanism.

FIG. 17 is a block diagram showing the configuration of the smartphone200 shown in FIG. 16.

As shown in FIG. 17, principal components of the smartphone comprise awireless communication unit 210, a display input unit 204, a callhandling unit 211, a manipulation unit 207, a camera unit 208, a storageunit 212, an external input and output unit 213, a Global PositioningSystem (GPS) receiving unit 214, a motion sensor unit 215, a powersupply unit 216, and a main controller 220.

Principal functions of the smartphone 200 comprise a wirelesscommunication function of performing mobile wireless communicationthrough a base station device BS (not shown) and a mobile communicationnetwork NW (not shown).

The wireless communication unit 210 performs wireless communication witha base station device BS in the mobile communication network NWaccording to a command of the main controller 220. With the use of thewireless communication, the transmission and reception of various kindsof file data, such as voice data and image data, and electronic maildata, or the reception of Web data and streaming data are performed.

The display input unit 204 is a so-called touch panel which displaysimages (still images and moving images) or character information tovisually transfer information to the user and detects a user'smanipulation on the displayed information under the control of the maincontroller 220, and comprises the display panel 202 and the manipulationpanel 203.

The display panel 202 uses a liquid crystal display (LCD) or an organicelectro-luminescence display (OELD) as a display device.

The manipulation panel 203 is a device which is placed such that animage displayed on a display surface of the display panel 202 isvisible, and detects one or a plurality of coordinates of a manipulationwith a user's finger or a stylus. In a case where the device ismanipulated with the user's finger or the stylus, a detection signal dueto the manipulation is output to the main controller 220. Next, the maincontroller 220 detects a manipulation position (coordinates) on thedisplay panel 202 based on the received detection signal.

As shown in FIG. 16, although the display panel 202 and the manipulationpanel 203 of the smartphone 200 illustrated as an embodiment of animaging device of the present invention are integrated to constitute thedisplay input unit 204, the manipulation panel 203 is arranged tocompletely cover the display panel 202.

In a case where this arrangement is employed, the manipulation panel 203may have a function of detecting a user's manipulation even in an areaoutside the display panel 202. In other words, the manipulation panel203 may comprise a detection area (hereinafter, referred to as a displayarea) for an overlapped portion which overlaps the display panel 202 anda detection area (hereinafter, referred to as a non-display area) for anouter edge portion which does not overlap the display panel 202 otherthan the display area.

Although the size of the display area may completely match the size ofthe display panel 202, it is not necessary to match both of the size ofthe display area and the size of the display panel. The manipulationpanel 203 may comprise two sensitive areas including an outer edgeportion and an inner portion other than the outer edge portion.

The width of the outer edge portion is appropriately designed accordingto the size of the casing 201 or the like. As a position detectionsystem which is employed in the manipulation panel 203, a matrixswitching system, a resistive film system, a surface acoustic wavesystem, an infrared system, an electromagnetic induction system, anelectrostatic capacitance system, and the like are exemplified, and anysystem can be employed.

The call handling unit 211 comprises the speaker 205 and the microphone206, converts voice of the user input through the microphone 206 tovoice data processable in the main controller 220 and outputs voice datato the main controller 220, or decodes voice data received by thewireless communication unit 210 or the external input and output unit213 and outputs voice from the speaker 205.

As shown in FIG. 16, for example, the speaker 205 can be mounted on thesame surface as the surface on which the display input unit 204 isprovided, and the microphone 206 can be mounted on the side surface ofthe casing 201.

The manipulation unit 207 is a hardware key using a key switch or thelike, and receives a command from the user. For example, as shown inFIG. 16, the manipulation unit 207 is a push button-type switch which ismounted on the side surface of the casing 201 of the smartphone 200, andis turned on by being depressed with a finger or the like and is turnedoff by restoration force of the panel or the like in a case where thefinger is released.

The storage unit 212 stores a control program or control data of themain controller 220, application software, address data in associationwith the name, telephone number, and the like of a communicationpartner, data of transmitted and received electronic mail, Web datadownloaded by Web browsing, and downloaded content data, and temporarilystores streaming data or the like.

The storage unit 212 is constituted by an internal storage unit 217embedded in the smartphone and an external storage unit 218 having aslot for a detachable external memory.

The internal storage unit 217 and the external storage unit 218constituting the storage unit 212 are realized using a memory (forexample, a microSD (Registered Trademark) memory or the like), such as aflash memory type, a hard disk type, a multimedia card micro type, or acard type, or a storage medium, such as a random access memory (RAM) ora read only memory (ROM).

The external input and output unit 213 plays a role of an interface withall external devices connected to the smartphone 200, and is providedfor direct or indirect connection to other external devices throughcommunication or the like (for example, universal serial bus (USB), IEEE1394, or the like), or a network (for example, the Internet, wirelessLAN, Bluetooth (Registered trademark), radio frequency identification(RFID), infrared communication (Infrared Data Association: IrDA)(Registered Trademark), Ultra Wideband (UWB) (Registered Trademark),ZigBee (Registered Trademark), or the like).

The external devices connected to the smartphone 200 are, for example, awired or wireless headset, a wired or wireless external charger, a wiredor wireless data port, a memory card connected through a card socket, asubscriber identity module (SIM) card, a user identity module (UIM)card, an external audio-video device connected through an audio-videoinput and output (I/O) terminal, an external audio-video deviceconnected in a wireless manner, a smartphone connected in a wired orwireless manner, a personal computer connected in a wired or wirelessmanner, a PDA connected in a wired or wireless manner, an earphoneconnected in a wired or wireless manner, and the like. The externalinput and output unit 213 can transfer data transmitted from theexternal devices to the respective components in the smartphone 200 orcan transmit data in the smartphone 200 to the external devices.

The GPS receiving unit 214 receives GPS signals transmitted from GPSsatellites ST1 to STn according to a command of the main controller 220,executes positioning calculation processing based on a plurality ofreceived GPS signals, and detects the position of the smartphone 200having latitude, longitude, and altitude.

In a case where positional information can be acquired from the wirelesscommunication unit 210 or the external input and output unit 213 (forexample, a wireless LAN), the GPS receiving unit 214 can detect theposition using the positional information.

The motion sensor unit 215 comprises, for example, a three-axisacceleration sensor or the like, and detects physical motion of thesmartphone 200 according to a command of the main controller 220. Themoving direction or acceleration of the smartphone 200 is detected bydetecting physical motion of the smartphone 200. The detection result isoutput to the main controller 220.

The power supply unit 216 supplies electric power stored in a battery(not shown) to the respective units of the smartphone 200 according to acommand of the main controller 220.

The main controller 220 comprises a microprocessor, operates accordingto the control program or control data stored in the storage unit 212,and integrally controls the respective units of the smartphone 200.

The main controller 220 has a mobile communication control function ofcontrolling respective units of a communication system in order toperform voice communication or data communication through the wirelesscommunication unit 210, and an application processing function.

The application processing function is realized by the main controller220 operating according to application software stored in the storageunit 212. The application processing function is, for example, aninfrared communication function of controlling the external input andoutput unit 213 to perform data communication with a device facing thesmartphone 200, an electronic mail function of transmitting andreceiving electronic mail, a Web browsing function of browsing Webpages, or the like.

The main controller 220 has an image processing function of displayingvideo on the display input unit 204, or the like based on image data(still image or moving image data), such as received data or downloadedstreaming data. The image processing function refers to a function ofthe main controller 220 decoding image data, performing image processingon the decoding result, and displaying an image on the display inputunit 204.

The main controller 220 executes display control on the display panel202 and manipulation detection control for detecting a user'smanipulation through the manipulation unit 207 and the manipulationpanel 203.

With the execution of the display control, the main controller 220displays an icon for activating application software or a software key,such as a scroll bar, or displays a window for creating electronic mail.

The scroll bar refers to a software key for receiving a command to movea display portion of an image which is too large to fit into the displayarea of the display panel 202.

With the execution of the manipulation detection control, the maincontroller 220 detects a user's manipulation through the manipulationunit 207, receives a manipulation on the icon or an input of a characterstring in an entry column of the window through the manipulation panel203, or receives a scroll request of a display image through the scrollbar.

In addition, with the execution of the manipulation detection control,the main controller 220 has a touch panel control function ofdetermining whether a manipulation position on the manipulation panel203 is the superimposed portion (display area) overlapping the displaypanel 202 or the outer edge portion (non-display area) not overlappingthe display panel 202 other than the display area, and controlling thesensitive area of the manipulation panel 203 or the display position ofthe software key.

The main controller 220 may detect a gesture manipulation on themanipulation panel 203 and may execute a function set in advanceaccording to the detected gesture manipulation.

The gesture manipulation is not a conventional simple touchmanipulation, but means a manipulation to render a track with a fingeror the like, a manipulation to simultaneously designate a plurality ofpositions, or a manipulation to render a track for at least one of aplurality of positions by combining the above-described manipulations.

The camera unit 208 includes the configuration other than the externalmemory controller 20, the recording medium 21, the display controller22, the display unit 23, and the manipulation unit 14 in the digitalcamera shown in FIG. 1 or 12. Captured image data generated by thecamera unit 208 can be recorded in the storage unit 212 or can be outputthrough the external input and output unit 213 or the wirelesscommunication unit 210.

In the smartphone 200 shown in FIG. 16, although the camera unit 208 ismounted on the same surface as the display input unit 204, the mountingposition of the camera unit 208 is not limited thereto, and the cameraunit 208 may be mounted on the rear surface of the display input unit204.

The camera unit 208 can be used for various functions of the smartphone200. For example, an image acquired by the camera unit 208 can bedisplayed on the display panel 202, or an image in the camera unit 208can be used as one manipulation input of the manipulation panel 203.

In a case where the GPS receiving unit 214 detects the position, theposition may be detected with reference to an image from the camera unit208. In addition, the optical axis direction of the camera unit 208 ofthe smartphone 200 can be determined or a current use environment may bedetermined with reference to an image from the camera unit 208 withoutusing the three-axis acceleration sensor or in combination with thethree-axis acceleration sensor. Of course, an image from the camera unit208 may be used in application software.

In addition, image data of a still image or a moving image may beattached with positional information acquired by the GPS receiving unit214, voice information (which may be converted to text informationthrough voice-text conversion by the main controller or the like)acquired by the microphone 206, posture information acquired by themotion sensor unit 215, or the like and can be recorded in the storageunit 212, or may be output through the external input and output unit213 or the wireless communication unit 210.

In the smartphone 200 having the aforementioned configuration, it ispossible to perform high-quality imaging through the aforementionedprocessing using the system controller 11 shown in FIG. 1 or 12.

Although it has been described in the aforementioned embodiment andmodification examples that the phase difference is detected in the rowdirection X, the present invention may be similarly applied to a casewhere the phase difference is detected in the column direction Y.

As described above, the following matters are disclosed in thisspecification.

(1) There is provided an imaging device comprising an imaging elementthat images a subject through an imaging optical system including afocus lens, first signal detection parts that detect signalscorresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of the imaging optical system, secondsignal detection parts that detect signals corresponding to the otherone of the pair of luminous fluxes, and a focusing controller thatselectively performs focusing control using a phase difference AF methodusing a result of a correlation operation of detection signals of thefirst signal detection parts and detection signals of the second signaldetection parts or focusing control using a contrast AF method usingcontrast of a captured image captured by the imaging element in a modein which focusing control for focusing on a main subject by driving thefocus lens is continuously performed multiple times. The focusingcontroller performs the focusing control using the contrast AF method ina case where a state in which a degree of reliability of the focusingcontrol using the phase difference AF method is equal to or less than athreshold value persists N times, N being a natural number of 2 or more,while the focusing control using the phase difference AF method iscontinuously performed.

(2) In the imaging device according to (1), the focusing controllerperforms variable control on a value of the N.

(3) In the imaging device according to (1) or (2), the focusingcontroller performs the focusing control using the contrast AF method ina case where the state in which the degree of reliability is equal to orless than the threshold value persists less than N times and an elapsedtime after the degree of reliability is equal to or less than thethreshold value reaches a time threshold value while the focusingcontrol using the phase difference AF method is continuously performed.

(4) In the imaging device according to any one of (1) to (3), thefocusing controller sets a first subject area, which is to be in focusin a case where the focusing control using the contrast AF method isperformed, to be an area which includes a second subject area to be infocus in the focusing control using the phase difference AF method andis larger than the second subject area.

(5) In the imaging device according to (4), the focusing controller setsa difference between a width of the second subject area in a firstdirection and a width of the first subject area in the first directionto be greater than a difference between a width of the second subjectarea in a second direction perpendicular to the first direction and awidth of the first subject area in the second direction.

(6) The imaging device according to (5) further comprises a detectionunit that detects a direction of gravity. The focusing controller setsthe first subject area with a direction perpendicular to the directionof gravity as the first direction.

(7) There is provided a focusing control method comprising a focusingcontrol step of selectively performing focusing control using a phasedifference AF method using a result of a correlation operation ofdetection signals of first signal detection parts that detect signalscorresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of an imaging optical system anddetection signals of second signal detection parts that detect signalscorresponding to the other one of the pair of luminous fluxes orfocusing control using a contrast AF method using contrast of a capturedimage captured by an imaging element that images a subject through theimaging optical system, in a case where focusing control for focusing ona main subject by driving a focus lens of the imaging optical systemincluding the focus lens is continuously performed multiple times. Inthe focusing control step, the focusing control using the contrast AFmethod is performed in a case where a state in which a degree ofreliability of the focusing control using the phase difference AF methodis equal to or less than a threshold value persists N times, N being anatural number of 2 or more, while the focusing control using the phasedifference AF method is continuously performed.

(8) In the focusing control method according to (7), in the focusingcontrol step, a value of the N is controlled.

(9) In the focusing control method according to (7) or (8), in thefocusing control step, the focusing control using the contrast AF methodis performed in a case where the state in which the degree ofreliability is equal to or less than the threshold value persists lessthan N times and an elapsed time after the degree of reliability isequal to or less than the threshold value reaches a time threshold valuewhile the focusing control using the phase difference AF method iscontinuously performed.

(10) In the focusing control method according to any one of (7) to (9),in the focusing control step, a first subject area to be in focus in acase where the focusing control using the contrast AF method isperformed is set to be an area which includes a second subject area tobe in focus in the focusing control using the phase difference AF methodand is larger than the second subject area.

(11) In the focusing control method according to (10), in the focusingcontrol step, a difference between a width of the second subject area ina first direction and a width of the first subject area in the firstdirection is set to be greater than a difference between a width of thesecond subject area in a second direction perpendicular to the firstdirection and a width of the first subject area in the second direction.

(12) The focusing control method according to (11) further comprises adetection step of detecting a direction of gravity. In the focusingcontrol step, the first subject area is set with a directionperpendicular to the direction of gravity as the first direction.

(13) There is provided a focusing control program causing a computer toperform a focusing control step of selectively performing focusingcontrol using a phase difference AF method using a result of acorrelation operation of detection signals of first signal detectionparts that detect signals corresponding to one of a pair of luminousfluxes passed through different portions of a pupil area of an imagingoptical system and detection signals of second signal detection partsthat detect signals corresponding to the other one of the pair ofluminous fluxes or focusing control using a contrast AF method usingcontrast of a captured image captured by an imaging element that imagesa subject through the imaging optical system, in a case where focusingcontrol for focusing on a main subject by driving a focus lens of theimaging optical system including the focus lens is continuouslyperformed multiple times. In the focusing control step, the focusingcontrol using the contrast AF method is performed in a case where astate in which a degree of reliability of the focusing control using thephase difference AF method is equal to or less than a threshold valuepersists N times, N being a natural number of 2 or more, while thefocusing control using the phase difference AF method is continuouslyperformed.

(14) There is provided an imaging device comprising an imaging elementthat images a subject through an imaging optical system including afocus lens, first signal detection parts that detect signalscorresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of the imaging optical system, secondsignal detection parts that detect signals corresponding to the otherone of the pair of luminous fluxes, and a processor that selectivelyperforms focusing control using a phase difference AF method using aresult of a correlation operation of detection signals of the firstsignal detection parts and detection signals of the second signaldetection parts or focusing control using a contrast AF method usingcontrast of a captured image captured by the imaging element in a modein which focusing control for focusing on a main subject by driving thefocus lens is continuously performed multiple times. The focusingcontroller performs the focusing control using the contrast AF method ina case where a state in which a degree of reliability of the focusingcontrol using the phase difference AF method is equal to or less than athreshold value persists N times, N being a natural number of 2 or more,while the focusing control using the phase difference AF method iscontinuously performed.

The present invention is applied to a digital camera to achieve highconvenience and effectiveness.

Although the present invention has been described in conjunction with aspecific embodiment, the present invention is not limited to theembodiment, and may be variously changed without departing from thetechnical spirit of the present invention disclosed herein.

This application is based on Japanese Patent Application (2016-110391),filed Jun. 1, 2016, the content of which is incorporated herein.

EXPLANATION OF REFERENCES

-   -   1: imaging lens    -   2: stop    -   4: lens controller    -   5: imaging element    -   6: analog signal processing unit    -   7: analog-to-digital conversion circuit    -   8: lens drive unit    -   9: stop drive unit    -   10: imaging element drive unit    -   11: system controller    -   14: manipulation unit    -   15: memory controller    -   16: main memory    -   17: digital signal processing unit    -   18: contrast AF processing unit    -   19: phase difference AF processing unit    -   20: external memory controller    -   21: recording medium    -   22: display controller    -   23: display unit    -   24: control bus    -   25: data bus    -   26: acceleration sensor    -   50: light receiving surface    -   51: pixel    -   52A, 52B: phase-difference detecting pixel    -   53: AF area    -   PL1, PL2, PL3: pair row    -   c: opening    -   PD: photoelectric conversion unit    -   X: row direction    -   Y: column direction    -   200: smartphone    -   201: casing    -   202: display panel    -   203: manipulation panel    -   204: display input unit    -   205: speaker    -   206: microphone    -   207: manipulation unit    -   208: camera unit    -   210: wireless communication unit    -   211: call handling unit    -   212: storage unit    -   213: external input and output unit    -   214: GPS receiving unit    -   215: motion sensor unit    -   216: power supply unit    -   217: internal storage unit    -   218: external storage unit    -   220: main controller    -   ST1 to STn: GPS satellite

What is claimed is:
 1. An imaging device comprising: an imaging elementcomprising a plurality of pixels, wherein the imaging element images asubject through an imaging optical system comprising a focus lens,wherein first signal detection parts of the plurality of pixels detectsignals corresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of the imaging optical system, andsecond signal detection parts of the plurality of pixels detect signalscorresponding to other one of the pair of luminous fluxes; and afocusing controller that selectively performs focusing control by aphase difference AF method using a result of a correlation operation ofdetection signals of the first signal detection parts and detectionsignals of the second signal detection parts or focusing control by acontrast AF method using contrast of a captured image captured by theimaging element in a mode in which focusing control for focusing on amain subject by driving the focus lens is continuously performedmultiple times, wherein the focusing controller performs the focusingcontrol by the contrast AF method in a case where a state in which adegree of reliability of the focusing control by the phase difference AFmethod is equal to or less than a threshold value persists N times, Nbeing a natural number of 2 or more, while the focusing control by thephase difference AF method is continuously performed, and the focusingcontroller performs the focusing control by the contrast AF method in acase where the state in which the degree of reliability is equal to orless than the threshold value persists less than N times and an elapsedtime after the degree of reliability is equal to or less than thethreshold value reaches a time threshold value while the focusingcontrol by the phase difference AF method is continuously performed. 2.The imaging device according to claim 1, wherein the focusing controllerperforms variable control on a value of the N.
 3. The imaging deviceaccording to claim 1, wherein the focusing controller sets a firstsubject area, which is to be in focus in a case where the focusingcontrol by the contrast AF method is performed, to be an area whichincludes a second subject area to be in focus in the focusing control bythe phase difference AF method and is larger than the second subjectarea.
 4. The imaging device according to claim 2, wherein the focusingcontroller sets a first subject area, which is to be in focus in a casewhere the focusing control by the contrast AF method is performed, to bean area which includes a second subject area to be in focus in thefocusing control by the phase difference AF method and is larger thanthe second subject area.
 5. The imaging device according to claim 3,wherein the focusing controller sets a difference between a width of thesecond subject area in a first direction and a width of the firstsubject area in the first direction to be greater than a differencebetween a width of the second subject area in a second directionperpendicular to the first direction and a width of the first subjectarea in the second direction.
 6. The imaging device according to claim4, wherein the focusing controller sets a difference between a width ofthe second subject area in a first direction and a width of the firstsubject area in the first direction to be greater than a differencebetween a width of the second subject area in a second directionperpendicular to the first direction and a width of the first subjectarea in the second direction.
 7. The imaging device according to claim5, wherein the focusing controller further detects a direction ofgravity, wherein the focusing controller sets the first subject areawith a direction perpendicular to the direction of gravity as the firstdirection.
 8. The imaging device according to claim 6, furthercomprising: a detection unit that detects a direction of gravity,wherein the focusing controller sets the first subject area with adirection perpendicular to the direction of gravity as the firstdirection.
 9. An imaging device comprising: an imaging elementcomprising a plurality of pixels, wherein the imaging element images asubject through an imaging optical system comprising a focus lens,wherein first signal detection parts of the plurality of pixels detectsignals corresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of the imaging optical system, andsecond signal detection parts of the plurality of pixels detect signalscorresponding to other one of the pair of luminous fluxes; a focusingcontroller that selectively performs focusing control by a phasedifference AF method using a result of a correlation operation ofdetection signals of the first signal detection parts and detectionsignals of the second signal detection parts or focusing control by acontrast AF method using contrast of a captured image captured by theimaging element in a mode in which focusing control for focusing on amain subject by driving the focus lens is continuously performedmultiple times; and a detection unit that detects a direction ofgravity, wherein the focusing controller performs the focusing controlby the contrast AF method in a case where a state in which a degree ofreliability of the focusing control by the phase difference AF method isequal to or less than a threshold value persists N times, N being anatural number of 2 or more, while the focusing control by the phasedifference AF method is continuously performed, the focusing controllersets a first subject area, which is to be in focus in a case where thefocusing control by the contrast AF method is performed, to be an areawhich includes a second subject area to be in focus in the focusingcontrol by the phase difference AF method and is larger than the secondsubject area, the focusing controller sets a difference between a widthof the second subject area in a first direction and a width of the firstsubject area in the first direction to be greater than a differencebetween a width of the second subject area in a second directionperpendicular to the first direction and a width of the first subjectarea in the second direction, and the focusing controller sets the firstsubject area with a direction perpendicular to the direction of gravityas the first direction.
 10. A focusing control method comprising: afocusing control step of selectively performing focusing control by aphase difference AF method using a result of a correlation operation ofdetection signals of first signal detection parts that detect signalscorresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of an imaging optical system anddetection signals of second signal detection parts that detect signalscorresponding to other one of the pair of luminous fluxes or focusingcontrol by a contrast AF method using contrast of a captured imagecaptured by an imaging element that images a subject through the imagingoptical system, in a case where focusing control for focusing on a mainsubject by driving a focus lens of the imaging optical system includingthe focus lens is continuously performed multiple times, wherein, in thefocusing control step, the focusing control by the contrast AF method isperformed in a case where a state in which a degree of reliability ofthe focusing control by the phase difference AF method is equal to orless than a threshold value persists N times, N being a natural numberof 2 or more, while the focusing control by the phase difference AFmethod is continuously performed, and in the focusing control step, thefocusing control by the contrast AF method is performed in a case wherethe state in which the degree of reliability is equal to or less thanthe threshold value persists less than N times and an elapsed time afterthe degree of reliability is equal to or less than the threshold valuereaches a time threshold value while the focusing control by the phasedifference AF method is continuously performed.
 11. The focusing controlmethod according to claim 10, wherein, in the focusing control step, avalue of the N is controlled.
 12. The focusing control method accordingto claim 10, wherein, in the focusing control step, a first subject areato be in focus in a case where the focusing control by the contrast AFmethod is performed is set to be an area which includes a second subjectarea to be in focus in the focusing control by the phase difference AFmethod and is larger than the second subject area.
 13. The focusingcontrol method according to claim 11, wherein, in the focusing controlstep, a first subject area to be in focus in a case where the focusingcontrol by the contrast AF method is performed is set to be an areawhich includes a second subject area to be in focus in the focusingcontrol by the phase difference AF method and is larger than the secondsubject area.
 14. The focusing control method according to claim 12,wherein, in the focusing control step, a difference between a width ofthe second subject area in a first direction and a width of the firstsubject area in the first direction is set to be greater than adifference between a width of the second subject area in a seconddirection perpendicular to the first direction and a width of the firstsubject area in the second direction.
 15. The focusing control methodaccording to claim 13, wherein, in the focusing control step, adifference between a width of the second subject area in a firstdirection and a width of the first subject area in the first directionis set to be greater than a difference between a width of the secondsubject area in a second direction perpendicular to the first directionand a width of the first subject area in the second direction.
 16. Thefocusing control method according to claim 14, further comprising: adetection step of detecting a direction of gravity, wherein, in thefocusing control step, the first subject area is set with a directionperpendicular to the direction of gravity as the first direction. 17.The focusing control method according to claim 15, further comprising: adetection step of detecting a direction of gravity, wherein, in thefocusing control step, the first subject area is set with a directionperpendicular to the direction of gravity as the first direction.
 18. Afocusing control method comprising: a focusing control step ofselectively performing focusing control by a phase difference AF methodusing a result of a correlation operation of detection signals of firstsignal detection parts that detect signals corresponding to one of apair of luminous fluxes passed through different portions of a pupilarea of an imaging optical system and detection signals of second signaldetection parts that detect signals corresponding to other one of thepair of luminous fluxes or focusing control by a contrast AF methodusing contrast of a captured image captured by an imaging element thatimages a subject through the imaging optical system, in a case wherefocusing control for focusing on a main subject by driving a focus lensof the imaging optical system including the focus lens is continuouslyperformed multiple times; and a detection step of detecting a directionof gravity, wherein, in the focusing control step, the focusing controlby the contrast AF method is performed in a case where a state in whicha degree of reliability of the focusing control by the phase differenceAF method is equal to or less than a threshold value persists N times, Nbeing a natural number of 2 or more, while the focusing control by thephase difference AF method is continuously performed, in the focusingcontrol step, a first subject area to be in focus in a case where thefocusing control by the contrast AF method is performed is set to be anarea which includes a second subject area to be in focus in the focusingcontrol by the phase difference AF method and is larger than the secondsubject area, in the focusing control step, a difference between a widthof the second subject area in a first direction and a width of the firstsubject area in the first direction is set to be greater than adifference between a width of the second subject area in a seconddirection perpendicular to the first direction and a width of the firstsubject area in the second direction, and in the focusing control step,the first subject area is set with a direction perpendicular to thedirection of gravity as the first direction.
 19. A computer readablenon-transitory storage medium storing a focusing control program causinga computer to perform: a focusing control step of selectively performingfocusing control by a phase difference AF method using a result of acorrelation operation of detection signals of first signal detectionparts that detect signals corresponding to one of a pair of luminousfluxes passed through different portions of a pupil area of an imagingoptical system and detection signals of second signal detection partsthat detect signals corresponding to other one of the pair of luminousfluxes or focusing control by a contrast AF method using contrast of acaptured image captured by an imaging element that images a subjectthrough the imaging optical system, in a case where focusing control forfocusing on a main subject by driving a focus lens of the imagingoptical system including the focus lens is continuously performedmultiple times, wherein, in the focusing control step, the focusingcontrol by the contrast AF method is performed in a case where a statein which a degree of reliability of the focusing control by the phasedifference AF method is equal to or less than a threshold value persistsN times, N being a natural number of 2 or more, while the focusingcontrol by the phase difference AF method is continuously performed, andin the focusing control step, the focusing control by the contrast AFmethod is performed in a case where the state in which the degree ofreliability is equal to or less than the threshold value persists lessthan N times and an elapsed time after the degree of reliability isequal to or less than the threshold value reaches a time threshold valuewhile the focusing control by the phase difference AF method iscontinuously performed.
 20. A computer readable non-transitory storagemedium storing a focusing control program causing a computer to perform:a focusing control step of selectively performing focusing control by aphase difference AF method using a result of a correlation operation ofdetection signals of first signal detection parts that detect signalscorresponding to one of a pair of luminous fluxes passed throughdifferent portions of a pupil area of an imaging optical system anddetection signals of second signal detection parts that detect signalscorresponding to other one of the pair of luminous fluxes or focusingcontrol by a contrast AF method using contrast of a captured imagecaptured by an imaging element that images a subject through the imagingoptical system, in a case where focusing control for focusing on a mainsubject by driving a focus lens of the imaging optical system includingthe focus lens is continuously performed multiple times; and a detectionstep of detecting a direction of gravity, wherein, in the focusingcontrol step, the focusing control by the contrast AF method isperformed in a case where a state in which a degree of reliability ofthe focusing control by the phase difference AF method is equal to orless than a threshold value persists N times, N being a natural numberof 2 or more, while the focusing control by the phase difference AFmethod is continuously performed, in the focusing control step, a firstsubject area to be in focus in a case where the focusing control by thecontrast AF method is performed is set to be an area which includes asecond subject area to be in focus in the focusing control by the phasedifference AF method and is larger than the second subject area, in thefocusing control step, a difference between a width of the secondsubject area in a first direction and a width of the first subject areain the first direction is set to be greater than a difference between awidth of the second subject area in a second direction perpendicular tothe first direction and a width of the first subject area in the seconddirection, and in the focusing control step, the first subject area isset with a direction perpendicular to the direction of gravity as thefirst direction.